import request from '../utils/request.js';

export const getAllFlower = () => {
  return request({
    url: '/admin/flower/getAllFlower',
    method: 'get',
  });
}

export const deleteFlowerById = (id) => {
  return request({
    url: `/admin/flower/deleteFlowerById`,
    method: 'delete',
    params: { id }
  });
}

export const starOrStopFlower = (flower) => {
  return request({
    url: `/admin/flower/updateFlowerStatus`,
    method: 'post',
    data: flower
  });
}

export const updateFlower = (flower) => {
    return request({
        url: `/admin/flower/updateFlower`,
        method: 'post',
        data: flower
    });
}

export const getFlowerByPage = (pageSelect) => {
    return request({
        url: `/admin/flower/getFlowerByPage`,
        method: 'get',
        params: pageSelect
    });
}

export const addFlower = (flower) => {
    return request({
        url: `/admin/flower/addFlower`,
        method: 'post',
        data: flower
    });
}

